package com.bdqn.t350.ch04mybatisplus.config;


import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

//1、生成一个bean 名称mybatisPlusConfig MybatisPlusConfig m= new MybatisPlusConfig();
//2、给com.bdqn.t350.ch04mybatisplus.mapper目录下的所有接口都生成一个实现类
//3、PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
@Configuration
@MapperScan("com.bdqn.t350.ch04mybatisplus.mapper")
public class MybatisPlusConfig {

    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }
}
